package br.seplan.controller;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import br.seplan.daos.PredioDAO;
import br.seplan.entidades.Predio;

@SuppressWarnings("serial")
public class ListarPrediosAction extends HttpServlet {
	
	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		PredioDAO pDao = new PredioDAO();
		ArrayList<Predio> predios = pDao.findAll();
		req.setAttribute("todosPredios", predios);
		req.getRequestDispatcher("listarPredios.jsp").forward(req, resp);
		
	}
	
	

}
